#pragma once
#include "IEventHandler.h"
#include "SOCK_Stream.h"
#include "INET_Addr.h"
#include "IReactor.h"
#include "stdafx.h"

#define CLOSE_CONNECTION  "EXIT"

template <typename T>
class ServiceHandler :
	public IEventHandler<T>
{
public:
	ServiceHandler(IReactor<T>* _reactor):reactor(_reactor){}
	virtual bool open(SOCK_Stream* st) = 0;
	SOCK_Stream &peer(){ return stream;	}

protected:
	IReactor<T>* reactor;

//private:
	SOCK_Stream stream;

};

